package com.qf.controller;




import com.qf.entity.R;
import com.qf.service.CartService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 购物车表(Cart)表控制层
 *
 * @author makejava
 * @since 2023-04-07 14:36:03
 */
@RestController
@RequestMapping("/cart")
public class CartController  {
    /**
     * 服务对象
     */
    @Resource
    private CartService cartService;
    //根据用户id查询购物车信息接口
    @RequestMapping("/queryByUid")
    public R selectByUid(int uid){
        return R.succ(cartService.quearyByUid(uid));
    }
    //购物车商品数量变化 金额也随之改变
    @RequestMapping("/updateByNumber")
    public R updateByNumber(int gid,int number){
        return R.succ(cartService.updateByNumber(gid,number));
    }

}

